import { createBrowserRouter, RouteObject } from 'react-router-dom'

import Home from '@/page/Home'
import Login from '@/page/Login'
import AuthRouter from './AuthRouter'
import Users from '@/page/Users'
import Roles from '@/page/Roles'
import Rights from '@/page/Rights'
import Reports from '@/page/Reports'
import Params from '@/page/Params'
import Orders from '@/page/Orders'
import Categories from '@/page/Categories'
import Goods from '@/page/Goods'

const routes:RouteObject[] = [
  {
    path: '/',
    element: <AuthRouter><Home /></AuthRouter>,
    children: [
      {
        path: '/users',
        element: <Users />,
      },
      {
        path: 'roles',
        element: <Roles />,
      },
      {
        path: 'rights',
        element: <Rights />,
      },
      {
        path: 'reports',
        element: <Reports />,
      },
      {
        path: 'params',
        element: <Params />,
      },
      {
        path: 'orders',
        element: <Orders />,
      },
      {
        path:"goods",
        element:<Goods />
      },
      {
        path:"categories",
        element:<Categories />
      },
    ],
  },
  {
    path: '/login',
    element: <Login />,
  },
] 

const router = createBrowserRouter(routes)

export default router
